package designmode.command.elc;

import java.util.Arrays;

import designmode.command.Command;
import designmode.command.NoCommand;

/**
 * Created by Administrator on 2017/11/1 0001.
 */
public class RemoteController
{
    Command[] onCommand;
    Command[] offCommand;

    public RemoteController()
    {
        onCommand = new Command[2];
        offCommand = new Command[2];
        Arrays.fill(onCommand, new NoCommand());
        Arrays.fill(offCommand, new NoCommand());
    }

    public void setCommand(int channel, Command ocmd, Command ofcmd)
    {
        onCommand[channel] = ocmd;
        offCommand[channel] = ofcmd;
    }

    public void btnPressOn(int channel)
    {
        onCommand[channel].execute();
    }

    public void btnPressOff(int channel)
    {
        onCommand[channel].execute();
    }
}
